<template>
	<view>
		<nav-back></nav-back>

		<view class="title">
			<text>您的购房状况 </text>
		</view>
		<view class="tip">最真实的自己，更快遇到最应该的那个人</view>


		<picker-view  @change="changeHouse" :value="houseValue" class="my-picker-view">
			<picker-view-column>
				<view class="item" v-for="(item,index) in houseList" :key="index">{{item}}</view>
			</picker-view-column>
		</picker-view>

		<button class="next" type="primary" @click="handleNext">下一步</button>
	</view>
</template>

<script>
	import request from '@/utils/request.js'
	import NavBack from '@/components/NavBack.vue'

	export default {
		components: {
			NavBack
		},
		data() {
			return {
				houseList: ['租房', '已购房', '需要时购置', '在单位宿舍', '单位购房'],
				house: '',
				houseValue: [2]
			}
		},
		onLoad() {
			this.house = this.houseList[2]
		},
		methods: {
			changeHouse(event) {
				let current = event.detail.value[0]
				console.log(current, 'changeHouse');
				this.houseValue[0] = current
				this.house = this.houseList[current]
			},
			handleNext() {
				getApp().globalData.userInfo.houseStatus = this.house
				console.log(this.house, 'this.house');
				uni.navigateTo({
					url: '/pages/userInfo/incomeInfo/incomeInfo'
				})
			},
		}
	}
</script>

<style lang="scss">
	@import "@/style/register.scss";
</style>